package com.ysy.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.Map;
import java.util.stream.Collectors;

@Getter
@AllArgsConstructor
public enum NoteLikeOrUnLikeEnum {
    //  状态(0：待审核 1：正常 2：删除 3：下架)
    // Status (0: Pending Review 1: Normal 2: Deleted 3: Deactivated)
    NOTE_ALREADY_LIKE(2L,"已经点赞"),
    NOTE_LIKE(1L,"点赞成功"),
    NOTE_UN_LIKE(0L,"未点赞"),
    NO_EXISTS(-1L,"未找到bitmap")
    ;

    private Long status;
    private String desc;

    private static Map<Long, NoteLikeOrUnLikeEnum> cache;

    static {
        cache = Arrays.stream(NoteLikeOrUnLikeEnum.values()).collect(Collectors.toMap(NoteLikeOrUnLikeEnum::getStatus, e -> e));
    }

    public static NoteLikeOrUnLikeEnum get(Long status) {
        return cache.get(status);
    }
}
